home *** CD-ROM | disk | FTP | other *** search
Wrap
<refentry id="libgimp-gimppaths" revision="19 Jan 2001"> <refmeta> <refentrytitle>gimppaths</refentrytitle> <manvolnum>3</manvolnum> <refmiscinfo>LIBGIMP Library</refmiscinfo> </refmeta> <refnamediv> <refname>gimppaths</refname><refpurpose></refpurpose> </refnamediv> <refsynopsisdiv><title>Synopsis</title> <synopsis> <link linkend="gchar">gchar</link>** <link linkend="gimp-path-list">gimp_path_list</link> (<link linkend="gint32">gint32</link> image_ID, <link linkend="gint">gint</link> *num_paths); <link linkend="gint">gint</link> <link linkend="gimp-path-get-points">gimp_path_get_points</link> (<link linkend="gint32">gint32</link> image_ID, <link linkend="gchar">gchar</link> *pathname, <link linkend="gint">gint</link> *path_closed, <link linkend="gint">gint</link> *num_path_point_details, <link linkend="gdouble">gdouble</link> **points_pairs); <link linkend="gchar">gchar</link>* <link linkend="gimp-path-get-current">gimp_path_get_current</link> (<link linkend="gint32">gint32</link> image_ID); <link linkend="gboolean">gboolean</link> <link linkend="gimp-path-set-current">gimp_path_set_current</link> (<link linkend="gint32">gint32</link> image_ID, <link linkend="gchar">gchar</link> *set_current_path_name); <link linkend="gboolean">gboolean</link> <link linkend="gimp-path-set-points">gimp_path_set_points</link> (<link linkend="gint32">gint32</link> image_ID, <link linkend="gchar">gchar</link> *pathname, <link linkend="gint">gint</link> ptype, <link linkend="gint">gint</link> num_path_points, <link linkend="gdouble">gdouble</link> *points_pairs); <link linkend="gboolean">gboolean</link> <link linkend="gimp-path-stroke-current">gimp_path_stroke_current</link> (<link linkend="gint32">gint32</link> image_ID); <link linkend="gint">gint</link> <link linkend="gimp-path-get-point-at-dist">gimp_path_get_point_at_dist</link> (<link linkend="gint32">gint32</link> image_ID, <link linkend="gdouble">gdouble</link> distance, <link linkend="gint">gint</link> *y_point, <link linkend="gdouble">gdouble</link> *gradient); <link linkend="gint">gint</link> <link linkend="gimp-path-get-tattoo">gimp_path_get_tattoo</link> (<link linkend="gint32">gint32</link> image_ID, <link linkend="gchar">gchar</link> *pathname); <link linkend="gchar">gchar</link>* <link linkend="gimp-get-path-by-tattoo">gimp_get_path_by_tattoo</link> (<link linkend="gint32">gint32</link> image_ID, <link linkend="gint">gint</link> tattoo); <link linkend="gboolean">gboolean</link> <link linkend="gimp-path-delete">gimp_path_delete</link> (<link linkend="gint32">gint32</link> image_ID, <link linkend="gchar">gchar</link> *path_name_to_del); <link linkend="gint">gint</link> <link linkend="gimp-path-get-locked">gimp_path_get_locked</link> (<link linkend="gint32">gint32</link> image_ID, <link linkend="gchar">gchar</link> *pathname); <link linkend="gboolean">gboolean</link> <link linkend="gimp-path-set-locked">gimp_path_set_locked</link> (<link linkend="gint32">gint32</link> image_ID, <link linkend="gchar">gchar</link> *pathname, <link linkend="gint">gint</link> lockstatus); <link linkend="gboolean">gboolean</link> <link linkend="gimp-path-set-tattoo">gimp_path_set_tattoo</link> (<link linkend="gint32">gint32</link> image_ID, <link linkend="gchar">gchar</link> *pathname, <link linkend="gint">gint</link> tattovalue); </synopsis> </refsynopsisdiv> <refsect1> <title>Description</title> <para> </para> </refsect1> <refsect1> <title>Details</title> <refsect2> <title><anchor id="gimp-path-list">gimp_path_list ()</title> <programlisting><link linkend="gchar">gchar</link>** gimp_path_list (<link linkend="gint32">gint32</link> image_ID, <link linkend="gint">gint</link> *num_paths);</programlisting> <para> List the paths associated with the passed image. </para> <para> List the paths associated with the passed image.</para> <para> </para><informaltable pgwide=1 frame="none" role="params"> <tgroup cols="2"> <colspec colwidth="2*"> <colspec colwidth="8*"> <tbody> <row><entry align="right"><parameter>image_ID</parameter> :</entry> <entry> The ID of the image to list the paths from. </entry></row> <row><entry align="right"><parameter>num_paths</parameter> :</entry> <entry> The number of paths returned. </entry></row> <row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> List of the paths belonging to this image. </entry></row> </tbody></tgroup></informaltable></refsect2> <refsect2> <title><anchor id="gimp-path-get-points">gimp_path_get_points ()</title> <programlisting><link linkend="gint">gint</link> gimp_path_get_points (<link linkend="gint32">gint32</link> image_ID, <link linkend="gchar">gchar</link> *pathname, <link linkend="gint">gint</link> *path_closed, <link linkend="gint">gint</link> *num_path_point_details, <link linkend="gdouble">gdouble</link> **points_pairs);</programlisting> <para> List the points associated with the named path. </para> <para> List the points associated with the named path.</para> <para> </para><informaltable pgwide=1 frame="none" role="params"> <tgroup cols="2"> <colspec colwidth="2*"> <colspec colwidth="8*"> <tbody> <row><entry align="right"><parameter>image_ID</parameter> :</entry> <entry> The ID of the image to list the paths from. </entry></row> <row><entry align="right"><parameter>pathname</parameter> :</entry> <entry> the name of the path whose points should be listed. </entry></row> <row><entry align="right"><parameter>path_closed</parameter> :</entry> <entry> Return if the path is closed. {0=path open, 1= path closed}. </entry></row> <row><entry align="right"><parameter>num_path_point_details</parameter> :</entry> <entry> The number of points returned. Each point is made up of (x,y,pnt_type) of floats. </entry></row> <row><entry align="right"><parameter>points_pairs</parameter> :</entry> <entry> The points in the path represented as 3 floats. The first is the x pos, next is the y pos, last is the type of the pnt. The type field is dependant on the path type. For beziers (type 1 paths) the type can either be {1.0= BEZIER_ANCHOR, 2.0= BEZIER_CONTROL}. Note all points are returned in pixel resolution. </entry></row> <row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> The type of the path. Currently only one type (1 = Bezier) is supported. </entry></row> </tbody></tgroup></informaltable></refsect2> <refsect2> <title><anchor id="gimp-path-get-current">gimp_path_get_current ()</title> <programlisting><link linkend="gchar">gchar</link>* gimp_path_get_current (<link linkend="gint32">gint32</link> image_ID);</programlisting> <para> The name of the current path. Error if no paths. </para> <para> The name of the current path. Error if no paths.</para> <para> </para><informaltable pgwide=1 frame="none" role="params"> <tgroup cols="2"> <colspec colwidth="2*"> <colspec colwidth="8*"> <tbody> <row><entry align="right"><parameter>image_ID</parameter> :</entry> <entry> The ID of the image to get the current paths from. </entry></row> <row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> The name of the current path. </entry></row> </tbody></tgroup></informaltable></refsect2> <refsect2> <title><anchor id="gimp-path-set-current">gimp_path_set_current ()</title> <programlisting><link linkend="gboolean">gboolean</link> gimp_path_set_current (<link linkend="gint32">gint32</link> image_ID, <link linkend="gchar">gchar</link> *set_current_path_name);</programlisting> <para> List the paths associated with the passed image. </para> <para> List the paths associated with the passed image.</para> <para> </para><informaltable pgwide=1 frame="none" role="params"> <tgroup cols="2"> <colspec colwidth="2*"> <colspec colwidth="8*"> <tbody> <row><entry align="right"><parameter>image_ID</parameter> :</entry> <entry> The ID of the image to list set the paths in. </entry></row> <row><entry align="right"><parameter>set_current_path_name</parameter> :</entry> <entry> The name of the path to set the current path to. </entry></row> <row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> TRUE on success. </entry></row> </tbody></tgroup></informaltable></refsect2> <refsect2> <title><anchor id="gimp-path-set-points">gimp_path_set_points ()</title> <programlisting><link linkend="gboolean">gboolean</link> gimp_path_set_points (<link linkend="gint32">gint32</link> image_ID, <link linkend="gchar">gchar</link> *pathname, <link linkend="gint">gint</link> ptype, <link linkend="gint">gint</link> num_path_points, <link linkend="gdouble">gdouble</link> *points_pairs);</programlisting> <para> Set the points associated with the named path. </para> <para> Set the points associated with the named path.</para> <para> </para><informaltable pgwide=1 frame="none" role="params"> <tgroup cols="2"> <colspec colwidth="2*"> <colspec colwidth="8*"> <tbody> <row><entry align="right"><parameter>image_ID</parameter> :</entry> <entry> The ID of the image to set the paths in. </entry></row> <row><entry align="right"><parameter>pathname</parameter> :</entry> <entry> The name of the path to create (if it exists then a unique name will be created - query the list of paths if you want to make sure that the name of the path you create is unique. This will be set as the current path. </entry></row> <row><entry align="right"><parameter>ptype</parameter> :</entry> <entry> The type of the path. Currently only one type (1 = Bezier) is supported. </entry></row> <row><entry align="right"><parameter>num_path_points</parameter> :</entry> <entry> The number of points in the path. Each point is made up of (x,y,type) of floats. Currently only the creation of bezier curves is allowed. The type parameter must be set to (1) to indicate a BEZIER type curve. For BEZIERS. Note the that points must be given in the following order... ACCACCAC ... If the path is not closed the last control point is missed off. Points consist of three control points (control/anchor/control) so for a curve that is not closed there must be at least two points passed (2 x,y pairs). If num_path_pnts % 3 = 0 then the path is assumed to be closed and the points are ACCACCACCACC. </entry></row> <row><entry align="right"><parameter>points_pairs</parameter> :</entry> <entry> The points in the path represented as 3 floats. The first is the x pos, next is the y pos, last is the type of the pnt. The type field is dependant on the path type. For beziers (type 1 paths) the type can either be {1.0= BEZIER_ANCHOR, 2.0= BEZIER_CONTROL}. Note all points are returned in pixel resolution. </entry></row> <row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> TRUE on success. </entry></row> </tbody></tgroup></informaltable></refsect2> <refsect2> <title><anchor id="gimp-path-stroke-current">gimp_path_stroke_current ()</title> <programlisting><link linkend="gboolean">gboolean</link> gimp_path_stroke_current (<link linkend="gint32">gint32</link> image_ID);</programlisting> <para> Stroke the current path in the passed image. </para> <para> Stroke the current path in the passed image.</para> <para> </para><informaltable pgwide=1 frame="none" role="params"> <tgroup cols="2"> <colspec colwidth="2*"> <colspec colwidth="8*"> <tbody> <row><entry align="right"><parameter>image_ID</parameter> :</entry> <entry> The ID of the image which contains the path to stroke. </entry></row> <row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> TRUE on success. </entry></row> </tbody></tgroup></informaltable></refsect2> <refsect2> <title><anchor id="gimp-path-get-point-at-dist">gimp_path_get_point_at_dist ()</title> <programlisting><link linkend="gint">gint</link> gimp_path_get_point_at_dist (<link linkend="gint32">gint32</link> image_ID, <link linkend="gdouble">gdouble</link> distance, <link linkend="gint">gint</link> *y_point, <link linkend="gdouble">gdouble</link> *gradient);</programlisting> <para> Get point on a path at a specified distance along the path. </para> <para> This will return the x,y position of a point at a given distance along the bezier curve. The distance will the obtained by first digitizing the curve internally an then walking along the curve. For a closed curve the start of the path is the first point on the path that was created. This might not be obvious. Note the current path is used.</para> <para> </para><informaltable pgwide=1 frame="none" role="params"> <tgroup cols="2"> <colspec colwidth="2*"> <colspec colwidth="8*"> <tbody> <row><entry align="right"><parameter>image_ID</parameter> :</entry> <entry> The ID of the image the paths belongs to. </entry></row> <row><entry align="right"><parameter>distance</parameter> :</entry> <entry> The distance along the path. </entry></row> <row><entry align="right"><parameter>y_point</parameter> :</entry> <entry> The y position of the point. </entry></row> <row><entry align="right"><parameter>gradient</parameter> :</entry> <entry> The gradient at the specified point. </entry></row> <row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> The x position of the point. </entry></row> </tbody></tgroup></informaltable></refsect2> <refsect2> <title><anchor id="gimp-path-get-tattoo">gimp_path_get_tattoo ()</title> <programlisting><link linkend="gint">gint</link> gimp_path_get_tattoo (<link linkend="gint32">gint32</link> image_ID, <link linkend="gchar">gchar</link> *pathname);</programlisting> <para> Returns the tattoo associated with the name path. </para> <para> This procedure returns the tattoo associated with the specified path. A tattoo is a unique and permanent identifier attached to a path that can be used to uniquely identify a path within an image even between sessions.</para> <para> </para><informaltable pgwide=1 frame="none" role="params"> <tgroup cols="2"> <colspec colwidth="2*"> <colspec colwidth="8*"> <tbody> <row><entry align="right"><parameter>image_ID</parameter> :</entry> <entry> The image. </entry></row> <row><entry align="right"><parameter>pathname</parameter> :</entry> <entry> the name of the path whose tattoo should be obtained. </entry></row> <row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> The tattoo associated with the name path. </entry></row> </tbody></tgroup></informaltable></refsect2> <refsect2> <title><anchor id="gimp-get-path-by-tattoo">gimp_get_path_by_tattoo ()</title> <programlisting><link linkend="gchar">gchar</link>* gimp_get_path_by_tattoo (<link linkend="gint32">gint32</link> image_ID, <link linkend="gint">gint</link> tattoo);</programlisting> <para> Return the name of the path with the given tattoo. </para> <para> The procedure returns the name of the path in the specified image which has the passed tattoo. The tattoos are unique within the image and will be preserved across sessions and through renaming of the path. An error is returned if no path woth the specified tattoo can be found.</para> <para> </para><informaltable pgwide=1 frame="none" role="params"> <tgroup cols="2"> <colspec colwidth="2*"> <colspec colwidth="8*"> <tbody> <row><entry align="right"><parameter>image_ID</parameter> :</entry> <entry> The image. </entry></row> <row><entry align="right"><parameter>tattoo</parameter> :</entry> <entry> The tattoo of the required path. </entry></row> <row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> The name of the path with the specified tattoo. </entry></row> </tbody></tgroup></informaltable></refsect2> <refsect2> <title><anchor id="gimp-path-delete">gimp_path_delete ()</title> <programlisting><link linkend="gboolean">gboolean</link> gimp_path_delete (<link linkend="gint32">gint32</link> image_ID, <link linkend="gchar">gchar</link> *path_name_to_del);</programlisting> <para> Delete the named paths associated with the passed image. </para> <para> Delete the named path.</para> <para> </para><informaltable pgwide=1 frame="none" role="params"> <tgroup cols="2"> <colspec colwidth="2*"> <colspec colwidth="8*"> <tbody> <row><entry align="right"><parameter>image_ID</parameter> :</entry> <entry> The ID of the image to list delete the paths from. </entry></row> <row><entry align="right"><parameter>path_name_to_del</parameter> :</entry> <entry> The name of the path to delete. </entry></row> <row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> TRUE on success. </entry></row> </tbody></tgroup></informaltable></refsect2> <refsect2> <title><anchor id="gimp-path-get-locked">gimp_path_get_locked ()</title> <programlisting><link linkend="gint">gint</link> gimp_path_get_locked (<link linkend="gint32">gint32</link> image_ID, <link linkend="gchar">gchar</link> *pathname);</programlisting> <para> Returns the locked status associated with the name path. </para> <para> This procedure returns the lock status associated with the specified path. A path can be \"locked\" which means that the transformation tool operations will also apply to the path.</para> <para> </para><informaltable pgwide=1 frame="none" role="params"> <tgroup cols="2"> <colspec colwidth="2*"> <colspec colwidth="8*"> <tbody> <row><entry align="right"><parameter>image_ID</parameter> :</entry> <entry> The image. </entry></row> <row><entry align="right"><parameter>pathname</parameter> :</entry> <entry> the name of the path whose locked status should be obtained. </entry></row> <row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> The lock status associated with the name path. 0 returned if the path is not locked. 1 is returned if the path is locked. </entry></row> </tbody></tgroup></informaltable></refsect2> <refsect2> <title><anchor id="gimp-path-set-locked">gimp_path_set_locked ()</title> <programlisting><link linkend="gboolean">gboolean</link> gimp_path_set_locked (<link linkend="gint32">gint32</link> image_ID, <link linkend="gchar">gchar</link> *pathname, <link linkend="gint">gint</link> lockstatus);</programlisting> <para> Set the locked status associated with the name path. </para> <para> This procedure sets the lock status associated with the specified path. A path can be \"locked\" which means that the transformation tool operations will also apply to the path.</para> <para> </para><informaltable pgwide=1 frame="none" role="params"> <tgroup cols="2"> <colspec colwidth="2*"> <colspec colwidth="8*"> <tbody> <row><entry align="right"><parameter>image_ID</parameter> :</entry> <entry> The image. </entry></row> <row><entry align="right"><parameter>pathname</parameter> :</entry> <entry> the name of the path whose locked status should be set. </entry></row> <row><entry align="right"><parameter>lockstatus</parameter> :</entry> <entry> The lock status associated with the name path. 0 if the path is not locked. 1 if the path is to be locked. </entry></row> <row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> TRUE on success. </entry></row> </tbody></tgroup></informaltable></refsect2> <refsect2> <title><anchor id="gimp-path-set-tattoo">gimp_path_set_tattoo ()</title> <programlisting><link linkend="gboolean">gboolean</link> gimp_path_set_tattoo (<link linkend="gint32">gint32</link> image_ID, <link linkend="gchar">gchar</link> *pathname, <link linkend="gint">gint</link> tattovalue);</programlisting> <para> Sets the tattoo associated with the name path. </para> <para> This procedure sets the tattoo associated with the specified path. A tattoo is a unique and permenant identifier attached to a path that can be used to uniquely identify a path within an image even between sessions. Note that the value passed to this function must have been obtained from a previous call to path_get_tattoo.</para> <para> </para><informaltable pgwide=1 frame="none" role="params"> <tgroup cols="2"> <colspec colwidth="2*"> <colspec colwidth="8*"> <tbody> <row><entry align="right"><parameter>image_ID</parameter> :</entry> <entry> The image. </entry></row> <row><entry align="right"><parameter>pathname</parameter> :</entry> <entry> the name of the path whose tattoo should be set. </entry></row> <row><entry align="right"><parameter>tattovalue</parameter> :</entry> <entry> The tattoo associated with the name path. Only values returned from 'path_get_tattoo' should be used here. </entry></row> <row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> TRUE on success. </entry></row> </tbody></tgroup></informaltable></refsect2> </refsect1> </refentry>